<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表白模块</title>
		<!-- import CSS -->
		<link rel="stylesheet" href="/static/element-ui/lib/theme-chalk/element.css">
		<!-- import Vue before Element -->
		<script src="/static/js/vue.js"></script>
		<!-- import JavaScript -->
		<script src="/static/element-ui/lib/index.js"></script>
		<script type="text/javascript" src="/static/layui/jquery.min.js"></script>
		<style>
			.divCss {
				width: 100%;
				height:100%;
				/* 边框属性 */
				border: 1px solid #cccccc;
				border-radius: 2px;
				/* 内边距 */
				padding: 10px;
				margin: 0 auto;
				/* 投影 */
				box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
			}
		</style>
	</head>
	<body>
		<div id="div">
			<div class="divCss">
				<template>
					<!-- border启用边框  heighit固定表头 fixed：固定列-->
					<el-table :data="tableData" border height="600px" style="width: 100%">
					
						<el-table-column fixed="left" prop="publish_time" label="表白时间" width="200">
						</el-table-column>
						
						<el-table-column prop="wallid" label="表白id" width="120">
						</el-table-column>
						
						<el-table-column prop="username" label="主动表白者" width="120">
						</el-table-column>
								
						<el-table-column prop="statement" label="表白短文" width="800">
						</el-table-column>	
										
						<el-table-column fixed="right" label="操作" width="90">
							<template slot-scope="scope">
								<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
								<el-button type="text" size="small">编辑</el-button>
							</template>
						</el-table-column>
					</el-table>
				</template>
			</div>
		</div>
	</body>
	<script>	
	
				var userid = [[${session.userid}]];
			    let indexList = new Vue({
			        el: '#div',
			        data:{
			            
			            	tableData: []
			        
			        },
			        mounted: function() {		           
			            this.showNewsDetail();
			        },
			        methods: {
			            //公告详情跳转
			            showNewsDetail:function(){
			            	var that = this;
			            	$.ajax({
			                    url: '/user/getlovewall',				                   
			                    contentType: "application/json;charset=UTF-8",
			                    dataType: 'json',
			                    success: function(msg) {
			                        that.tableData=msg.data;
			                        console.log(msg.data);
			                    },error:function () {
			                        console.log("err");
			                    }
			                });
			            }
			        }
			    });		
		</script>
</html>
